<script>
    jQuery(function($) {
        document.getElementById('a').onclick = function () {
            var arr = new Array(6);
            arr[0] = "a";
            arr[1] = "b";
            arr[2] = "c";
            arr[3] = "d";
            arr[4] = "e";
            arr[5] = "f";

            arr.splice(2,0,"你好");
            alert(arr)
        }
    });
</script>
<div class="bord">
    <div class="title">splice</div>
    <div class="introduce">
        splice() 方法向/从数组中添加/删除项目，然后返回被删除的项目。<br/>
        该方法会改变原始数组。
    </div>
</div>
<div class="bord">
    <div class="title">演示效果</div>
    <pre>
        在 a b c d e f  数组中,在第2个位置后面添加一个“你好”，并返回新的数组。
    </pre>
    <button class="introduce" id="a">打印结果</button>
</div>
<div class="bord">
    <div class="title">代码</div>
    <div class="introduce">
        <pre>
                &lt;script&gt;
        jQuery(function($) {
            document.getElementById('a').onclick = function () {
                var arr = new Array(6);
                arr[0] = "a";
                arr[1] = "b";
                arr[2] = "c";
                arr[3] = "d";
                arr[4] = "e";
                arr[5] = "f";

                arr.splice(2,0,"你好");
                alert(arr)
            }
        });
                &lt;/script&gt;
        </pre>
    </div>
</div>